﻿//-----------------------------------------------------------------------
// <copyright file="Tag.cs" company="Forebrain Technology, LLC">
//
// Copyright (c) Forebrain Technology, LLC. All rights reserved.
// 
// This source code is released under the Microsoft Public License (Ms-PL).
//
// </copyright>
//-----------------------------------------------------------------------
namespace PivotCollectionTools.Xml
{
    using System;
    using System.Xml;
    using System.Xml.Serialization;

    /// <summary>
    /// A list of tags for an item. A tag can only contain the tag value, nothing else.
    /// </summary>
    /// <remarks/>
    [SerializableAttribute()]
    [XmlType(Namespace = "http://schemas.microsoft.com/collection/metadata/2009")]
    public class Tag
    {
        /// <summary>
        /// Used to store any other XML attributes.
        /// </summary>
        private AttributeCollection anyOtherAttributes;

        /// <summary>
        /// Initializes a new instance of the <see cref="Tag"/> class.
        /// </summary>
        public Tag()
        {
            this.anyOtherAttributes = new AttributeCollection();
        }

        /// <summary>
        /// Gets any other XML attributes for the Tag XML node.
        /// </summary>
        /// <value>Any other attributes of the tag.</value>
        [XmlAnyAttribute()]
        public AttributeCollection AnyOtherAttributes
        {
            get
            {
                return this.anyOtherAttributes;
            }
        }

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        /// <value>The value of the tag.</value>
        [XmlText()]
        public string Value { get; set; }
    }
}
